How can we know the number of days between two given dates using PHP? Anonymous User194713-Jun-2011phpphp Updated on 23-Sep-2020
Anonymous User
13-Jun-2011We will use following concept to retrive difference between two dates.
$date1 = date('Y-m-d');
$date2 = '2006-07-01';
$days = (strtotime() - strtotime()) / (60 * 60 * 24);
echo "Number of days since '2006-07-01': $days";